#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QTableWidgetItem>
#include <QPushButton>
#include <QComboBox>
#include <QFile>

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();
signals:
    void connected();
    void disconnected();

private slots:
    void aboutQtDialog();
    void deleteOne();
    void deleteAll();
    void connectToFile();
    void add();
    void refresh();
    void search();
    void disconnectFromFile();
    void updateInfo(int row, int column);
    void filtering();
    void available();
    void notAvailable();
    void saveToFile();
    void sortBy(int column);

private:
    Ui::MainWindow *ui;
    QPushButton *applyFilter;
    QPushButton *clearFilter;
    QLineEdit *filter;
    QComboBox *filterAs;
    QFile file;
    QString fileName;
    bool isIdValid(QString beingCheck) const;

};

#endif // MAINWINDOW_H
